<template>
  <views class="gen_log_detail">
    <!-- 代发记录-详情 -->
    <div class="order_information">
      <viewTitle :title="'订单信息'" :border="false"></viewTitle>
      <div class="order_list">
        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">批次编号:</div>
            <div class="order_item_content">{{detail_basic.enterprise_order_sn||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">订单编号:</div>
            <div class="order_item_content">{{detail_basic.enterprise_order_ext_sn||''}}</div>
          </div>
        </div>
        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">客户编号:</div>
            <div class="order_item_content">{{detail_basic.client_sn||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">客户名称:</div>
            <div class="order_item_content">{{detail_basic.client_name||''}}</div>
          </div>
        </div>
        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">服务商编号:</div>
            <div class="order_item_content">{{detail_basic.facilitator_sn||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">服务商名称:</div>
            <div class="order_item_content">{{detail_basic.facilitator_name||''}}</div>
          </div>
        </div>
        <!-- <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">业务订单号:</div>
            <div class="order_item_content">缺少字段</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl"></div>
            <div class="order_item_content"></div>
          </div>
        </div> -->
      </div>
    </div>

    <!-- 付款信息 -->
    <div class="payment_information">
      <viewTitle :title="'付款信息'" :border="false"></viewTitle>
      <div class="order_list">
        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">交易金额:</div>
            <div class="order_item_content">￥{{detail_pay.real_money||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">账户名称:</div>
            <div class="order_item_content">{{detail_pay.rec_bank_account||''}}</div>
          </div>
        </div>

        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">账号类型:</div>
            <div class="order_item_content">{{detail_pay.rec_bank_type_name||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">收款账号:</div>
            <div class="order_item_content">{{detail_pay.rec_bank_code||''}}</div>
          </div>
        </div>

        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">业绩说明:</div>
            <div class="order_item_content">{{detail_pay.remark||''}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl"></div>
            <div class="order_item_content"></div>
          </div>
        </div>
      </div>
    </div>

    <!-- 业务信息 -->
    <div class="professional_information">
      <viewTitle :title="'业务信息'" :border="false"></viewTitle>
      <div class="order_list">
        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">业务类型:</div>
            <div class="order_item_content">{{detail_business.op_type_name}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">业务状态:</div>
            <div class="order_item_content">{{detail_business.op_status_name}}</div>
          </div>
        </div>

        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">创建时间:</div>
            <div class="order_item_content">{{detail_business.create_time}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">订单(审核)时间:</div>
            <div class="order_item_content">{{detail_business.update_time}}</div>
          </div>
        </div>

        <div class="flex flexR order_item">
          <div class="flex order_w">
            <div class="order_item_title Textl">应答码:</div>
            <div class="order_item_content">{{detail_business.pay_code_back}}</div>
          </div>
          <div class="flex order_w">
            <div class="order_item_title Textl">应答描述</div>
            <div class="order_item_content">{{detail_business.pay_err_msg}}</div>
          </div>
        </div>
      </div>
    </div>
  </views>
</template>


<script>
export default {
  data() {
    return {
        detail_basic:{ },  // 批次信息
        detail_pay:{},     // 付款信息
        detail_business:{},// 业务信息
    };
  },
  computed: {
    getTerrace(){     //获取当前用户类型；1：企业、2：代理商、3：服务商
      return  this.$store.state.terrace;      
    }
  },
  methods: {
    getData(enterprise_order_ext_id) {
      let res = {};
      if(this.getTerrace == 1){     //企业
        res = this.$api.sendSync(this.$mapapi.e_getOrderExtDetail,{enterprise_order_ext_id:enterprise_order_ext_id});
      }else if(this.getTerrace == 3){     //服务商
        res = this.$api.sendSync(this.$mapapi.f_getOrderExtDetail,{enterprise_order_ext_id:enterprise_order_ext_id});
      }
      if(res.code != 200){
        this.$message.error(data.msg);
        return;
      }
      this.detail_basic = res.data.detail_basic || {};
      this.detail_pay = res.data.detail_pay || {};
      this.detail_business = res.data.detail_business || {};

    }
  },
  mounted() {
    this.$setRouteTitle();
    console.log("路由传入的参数", this.$route);
    this.getData(this.$route.query.enterprise_order_ext_id)
  },
  created() {}
};
</script>


<style lang="less"  :scope="true"  src="@/style/issuing/gen_log_detail.less">
</style>